package com.pengtu.gsj.dao.system;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.app.Warning;

@Repository
public class WarningDao extends HibernateDao<Warning, String> {

	/**
	 * 
	 * getWarnings:
	 * 适用:获取10条没有关闭的预警信息
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	@SuppressWarnings("unchecked")
	public List<Warning> getWarnings() {
		String hql = "from Warning t where t.status='0' and t.delFlag = '0' order by t.notifiTime ASC ";
		Query query = getSession().createQuery(hql);
		query.setFirstResult(0);
		query.setMaxResults(10);
		return query.list();
	}
}
